package cn.frank.framework.caesar.module.ai.langChain4j.domain.vo.page;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.SchemaProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 分页对象
 *
 * @param <T>
 * @author hl
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "分页对象")
@Accessors(chain = true)
public class PageData<T> {

    // 总条数
    @SchemaProperty(name = "总条数")
    private long total;

    // 总页数
    @SchemaProperty(name = "总页数")
    private int pages;

    // 每页显示条数
    @SchemaProperty(name = "每页显示条数")
    private int pageSize;

    // 页码数
    @SchemaProperty(name = "页码数")
    private int pageNum = 1;

    // 列表数据
    @SchemaProperty(name = "列表数据")
    private List<T> data;

    @JsonProperty("data")
    public List<T> getData() {
        return this.data;
    }

}
